package com.itheima.config;
//在service,controller等业务层上下传送数据，称为基础上下文
public class BaseContext {
    public static final ThreadLocal<Long> threadLocal =  new ThreadLocal<>();
//    get任何参数不用传，key是当前线程ThreadLocalMap
    public static Long getCurrentId(){
        return threadLocal.get();
    }
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }
    public static void remove(){
        threadLocal.remove();
    }

}
